﻿package org.dm.motion 
{
	import flash.display.Shape;
	import flash.events.Event;
	import org.dm.general.ClassGather;
	import org.dm.utils.Map;
	/**
	 * ...
	 * @author Scott
	 */
	public class AnimateMsg extends Shape
	{
		private static var _instance:AnimateMsg;
		private static var _container:Map;
		
		public static function get Instance():AnimateMsg 
		{ 
			if(_instance==null)
			{
				var name:String = "org.dm.motion.AnimateMsg";
				_instance = ClassGather.Get(name) as org.dm.motion.AnimateMsg;
				if(_instance==null)
				{
					_instance = new org.dm.motion.AnimateMsg();
					ClassGather.Reg(name,_instance);
				}
			}
			
			return _instance;
		}
		
		public function AnimateMsg() 
		{
			_container = new Map();
		}
		
		public function add(anim:AnimateBase,key:String):void 
		{
			Instance.container.insert(key, anim);
		}
		
		public function remove(key:String):void 
		{
			Instance.container.remove(key);			
		}
		
		public function start():void 
		{
			this.addEventListener(Event.ENTER_FRAME, render);
		}
		
		public function stop():void 
		{
			this.removeEventListener(Event.ENTER_FRAME, render);
		}
		
		public function render(e:Event):void 
		{
			if(Instance.container.
		}
		
		public function get container():Map 
		{ 
			return _container; 
		}
	}

}